package org.joy.pagerank;

public class RankRecord {
	private double rank;
	private String[] urlList = new String[0];

	public double getRank() {
		return rank;
	}

	public String[] getUrlList() {
		return urlList;
	}

	public RankRecord(String str) {
		super();
		String[] items = str.split(" ");
		this.rank = Double.parseDouble(items[0]);
		if (items.length == 2)
			this.urlList = items[1].split(";");
	}

	public RankRecord(double rank, String[] urlList) {
		super();
		this.rank = rank;
		this.urlList = urlList;
	}

	public String toString() {
		String res = "";
		for (String s : urlList) {
			res += s + ";";
		}
		return rank + " " + res;
	}
}
